package com.lingjtx.common.core.algorithm;

import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Base64;

public class KeyStore {

    private PublicKey publicKey;

    private PrivateKey privateKey;

    public KeyStore(PublicKey publicKey, PrivateKey privateKey) {
        this.publicKey = publicKey;
        this.privateKey = privateKey;
    }

    public String getPublicKey() {
        return Base64.getEncoder().encodeToString(publicKey.getEncoded());
    }

    public void setPublicKey(PublicKey publicKey) {
        this.publicKey = publicKey;
    }

    public String getPrivateKey() {
        return Base64.getEncoder().encodeToString(privateKey.getEncoded());
    }

    public void setPrivateKey(PrivateKey privateKey) {
        this.privateKey = privateKey;
    }
}
